package com.yang.springcloud.service.impl;

import com.yang.springcloud.dao.DeptDao;
import com.yang.springcloud.pojo.Dept;
import com.yang.springcloud.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 服务层这里不提供服务，所以要通过controller的方式来提供restful服务
 *
 * @author shiwen
 * @date 2020/10/12
 */
@Service
public class DeptServiceImpl implements IDeptService {

    @Autowired
    private DeptDao deptDao;

    @Override
    public boolean addDept(Dept dept) {
        return deptDao.addDept(dept);
    }

    @Override
    public Dept queryDeptById(long id) {
        return deptDao.queryDeptById(id);
    }

    @Override
    public List<Dept> queryAll() {
        return deptDao.queryAll();
    }

    @Override
    public String getNameById(long id) {
        return deptDao.getNameById(id);
    }

}